<template>
    <div>
        <h1>汽车管理</h1>
        <img src="/project/html/image/2.jpg" width="600" height="400">
        <ListCar :cutBean="cutBean" @page="findByItem" @show="show"></ListCar>
        <AddCar @page="findByItem"></AddCar>
        <UpdateCar :carObj="carObj" @find="findByItem"></UpdateCar>
    </div>
</template>

<script>
import ListCar from "./carPage/ListCar.vue"
import AddCar from "./carPage/AddCar.vue"
import UpdateCar from "./carPage/UpdateCar.vue"

export default {
    components:{ListCar,AddCar,UpdateCar},
    data(){
        return{
            cutBean:{},
            carObj:{}
        }
    },
    methods:{
        async findByItem(param){
            var cutObj = await this.ajax.getSubmit("/project/car/findByItem",param);
            this.cutBean = cutObj;
        },
        show(car){
            this.carObj = car;
        }
    },
    created(){
        this.findByItem({pageNO:1})
    }
}
</script>

<style>

</style>
